package de.vendo.gui.menu;

public abstract class Rolle {
	public abstract String getInfo();

	public abstract String[] getCommands();

	public abstract String getMenuName();

	public abstract void process(String command);
	
	protected MenueAusgabe ausgabe;
	
	public Rolle(MenueAusgabe menueAusgabe) {
		this.ausgabe = menueAusgabe;
	}

	public Integer getCommandNumber(String command) {
		try {
			Integer n = Integer.valueOf(command);
			if (n >= 1 && n <= getCommands().length) {
				return n;
			}
		} catch (NumberFormatException e) {}
		
		return null;
	}

}
